package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.entity.QuartzTask;
import com.example.demo.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Select("SELECT * FROM user")
    List<User> findAll();


    @Select("SELECT * FROM user where id=#{id} ")
    User getById(Long id);


    @Insert({ "insert into user(phone, name, create_time) values(#{phone}, #{name}, #{createTime, jdbcType=TIMESTAMP})" })
    int insertSysRole(User user);

    @Update("UPDATE user SET age=#{age} WHERE id=#{id}")
    int update(User user);
}
